using TodoPro.System.Event;
using UnityEngine;
using NotImplementedException = System.NotImplementedException;

namespace TodoPro.System.Command
{
    public class FinishTodoCommand : ITodoCommand
    {
        private readonly string mTodoId;

        public FinishTodoCommand(string id)
        {
            mTodoId = id;
        }
        
        public void Execute()
        {
            var todoModel = TodoProConfig.GetModel<ITodoModel>();

            var todo = todoModel.GetAll().Find(t => t.Id == mTodoId);

            todo.Finished = true;
        }
    }
}